<?php
	include_once 'function.php';
	session_start();
	/*
	 * 基本路径设置
	 */
	define('_ADMIN_PATH','/admin/zjxad/');
	define('_BASE_PATH','/admin/');
	
	set_include_path(dirname(dirname(__FILE__)).'/libs' . PATH_SEPARATOR .PATH_SEPARATOR .get_include_path() );
	date_default_timezone_set('Asia/Shanghai');
	if (!function_exists('__autoload')) {
	    function __autoload($className)
	    {
	        if (substr($className, 0, 4) === 'Ice_') {
	            return;
	        }
	        include_once implode('/', explode('_', $className)) . '.php';
	    }
	}
	
//	$myhost			= "ctc-vdb1.chinadns.net";
//	$mydbuser 		= "web411039";
//	$mydbpass 		= "huangzy1985";
	$myhost			= "localhost";
	$mydbuser 		= "root";
	$mydbpass 		= "";
	$mydbname		= "db_web411039";
	$mydbcharset	= "utf8";
	
	$conn = mysql_connect($myhost,$mydbuser,$mydbpass);
	
	mysql_select_db($mydbname);
	
	mysql_query("set names $mydbcharset");
	
	$userGrade = array(
		array('part'=>'超级管理员','operate'=>'超级管理员可进行一切操作','limit'=>1),
		array('part'=>'管理员','operate'=>'管理员可操作文章和留言，但不可改变模块','limit'=>2),
		array('part'=>'会员','operate'=>'可查看一切信息和操作留言，但不能有操作','limit'=>3),
	);
	/*
	 * 模块分类
	 */
	$monGroup = array( 
		'showmod'=>'模块展示',
		'showtit'=>'标题展示',
		'product'=>'产品展示',
		'content'=>'内容展示',
		'msgboard'=>'留言板',
	);
	/*
	 * 广告分类
	 */
	
	$poster_cate = array(
		1=>'子页右侧广告',
		//2=>'文章内容左上广告',
		//3=>'文章内容左下广告',
		//4=>'文章内容右上广告',
		//5=>'文章内容右下广告',
		6=>'网页标题广告'
	);

	function putselect($name,$group,$selected=''){
		$ret = "<select name='".$name."'>";
		foreach ($group as $k=>$v){
			$ret .= "<option value='".$k."'";
			if($k == $selected)$ret .= ' selected ';
			$ret .=">".$v."</option>";
		}
		$ret .="</select>";
		
		return $ret;
	}